package com.example.PullGame;

import android.content.pm.ActivityInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;

import com.example.wonderfulradish.R;

public class PullDrawView extends AppCompatActivity {

    static int screenHeight;
    static int screenWidth;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//不显示标题栏
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//不显示状态栏
        //this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);//由系统自定义选择
        this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//设置游戏为竖屏
        //this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//设置游戏为横屏
        screenHeight=this.getWindowManager().getDefaultDisplay().getHeight();//得到屏幕高度
        screenWidth=this.getWindowManager().getDefaultDisplay().getWidth();//得到屏幕宽度
        setContentView(new PullGameView(this));//设置gameView实类
    }

    //返回屏幕高度
    public static int getScreenHeight() {
        return screenHeight;
    }


    //返回屏幕宽度
    public static int getScreenWidth() {
        return screenWidth;
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}
